package com.springboot.demo.design.pattern.plugin.impl;

import com.springboot.demo.design.pattern.instruction.Instruction;
import com.springboot.demo.design.pattern.plugin.FrontPlugin;
import java.lang.reflect.Method;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

/**
 * 用户前置插件
 *
 * @author supu
 * @date 2019-03-27 14:34
 **/
@Component
@Log4j2
public class UserLogFrontPlugin implements FrontPlugin {
    @Override
    public void interceptor(Object proxy, Method method, Object[] args) {
        Instruction instruction = (Instruction) args[0];
        log.warn("formNo:{} 开始记录日志", instruction.getForm().getFormNo());
    }
}
